<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\base\\System\\CPUTime.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE CPP, CApiFFI #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  System.CPUTime</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- The standard CPUTime library.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-comment">-- For various _POSIX_* #defines</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-pragma">{-# LINE 23 &quot;libraries\\base\\System\\CPUTime.hsc&quot; #-}</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-pragma">{-# LINE 25 &quot;libraries\\base\\System\\CPUTime.hsc&quot; #-}</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.CPUTime</span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.CPUTime.html#getCPUTime"><span class="hs-identifier">getCPUTime</span></a></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.CPUTime.html#cpuTimePrecision"><span class="hs-identifier">cpuTimePrecision</span></a></span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.IO.Unsafe.html"><span class="hs-identifier">System.IO.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier">unsafePerformIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">-- Here is where we decide which backend to use</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-pragma">{-# LINE 35 &quot;libraries\\base\\System\\CPUTime.hsc&quot; #-}</span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">System.CPUTime.Windows</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">I</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-pragma">{-# LINE 55 &quot;libraries\\base\\System\\CPUTime.hsc&quot; #-}</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-comment">-- | The 'cpuTimePrecision' constant is the smallest measurable difference</span><span>
</span><span id="line-57"></span><span class="hs-comment">-- in CPU time that the implementation can record, and is given as an</span><span>
</span><span id="line-58"></span><span class="hs-comment">-- integral number of picoseconds.</span><span>
</span><span id="line-59"></span><span class="annot"><a href="System.CPUTime.html#cpuTimePrecision"><span class="hs-identifier hs-type">cpuTimePrecision</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span>
</span><span id="line-60"></span><span id="cpuTimePrecision"><span class="annot"><span class="annottext">cpuTimePrecision :: Integer
</span><a href="System.CPUTime.html#cpuTimePrecision"><span class="hs-identifier hs-var hs-var">cpuTimePrecision</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Integer -&gt; Integer
forall a. IO a -&gt; a
</span><a href="GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO Integer
</span><a href="System.CPUTime.Windows.html#getCpuTimePrecision"><span class="hs-identifier hs-var">I.getCpuTimePrecision</span></a></span><span>
</span><span id="line-61"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="System.CPUTime.html#cpuTimePrecision"><span class="hs-pragma hs-type">cpuTimePrecision</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-comment">-- | Computation 'getCPUTime' returns the number of picoseconds CPU time</span><span>
</span><span id="line-64"></span><span class="hs-comment">-- used by the current program.  The precision of this result is</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- implementation-dependent.</span><span>
</span><span id="line-66"></span><span class="annot"><a href="System.CPUTime.html#getCPUTime"><span class="hs-identifier hs-type">getCPUTime</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span>
</span><span id="line-67"></span><span id="getCPUTime"><span class="annot"><span class="annottext">getCPUTime :: IO Integer
</span><a href="System.CPUTime.html#getCPUTime"><span class="hs-identifier hs-var hs-var">getCPUTime</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Integer
</span><a href="System.CPUTime.Windows.html#getCPUTime"><span class="hs-identifier hs-var">I.getCPUTime</span></a></span><span>
</span><span id="line-68"></span></pre></body></html>